
	export default {
		data() {
			return {
				allSize: null,
				
				// 记录总页数
				allPage: null,
				
				status: 'loadmore',
				
				// 记录页数
				page: 1,
				pageSize: 10,
				// 公司的数量
				allCompany: [],
				
			}
		},
		beforeMount() {
			this.checkCompany()
		},
		
		methods: {
			refreshArr() {
			
					if (this.page >= this.allPage) {
						this.status = 'nomore';
						return
					}
					this.status = 'loading';
					this.page = ++this.page;
					setTimeout(() => {
						this.checkCompany()
						if (this.page >= this.allPage) this.status = 'nomore';
						else this.status = 'loading';
					}, 2000)
				
			
			},
			toDetailEnterprise(){
				uni.navigateTo({
					url:`/pagesFind/detailenterprise/detailenterprise`
				})
			},
			// 查询企业
			checkCompany() {
			
				
				if(this.allCompany.length==0){
					this.loading=true
				}
				this.$app.request({
					url: this.$baseApp.api.dicData.findAll,
					data: {
					
						'page': this.page,
						"pageSize": this.pageSize
					},
					method: 'GET',
					dataType: 'json',
					success: res => {
						if (res.code == 200) {
							this.allPage = res.data.totalPages
							this.allSize = res.data.totalElements
							if (this.allPage <= 1) {
								this.status = 'nomore'
							}
							
							res.data.content.forEach((item) => {
								
								this.allCompany.push(item)
							})
							
						} 
					},
					complete: res => {
						this.loading=false
						
					}
				});
			}
		}
	}
